Chart B
rest_inspec %>%
group_by(boro, grade) %>%
summarize(n = n()) %>%
plot_ly(x = ~grade, y = ~n, color = ~boro, colors = "viridis") %>%
layout(title="Count of Grades in Boroughs")
## `summarise()` regrouping output by 'boro' (override with `.groups` argument)
## No trace type specified:
## Based on info supplied, a 'bar' trace seems appropriate.
## Read more about this trace type -> https://plot.ly/r/reference/#bar
Chart C
rest_inspec %>%
filter(boro != "Missing") %>%
mutate(boro = str_to_title(boro)) %>%
plot_ly(x = ~boro, y = ~score, type = "box", color = ~boro, colors = "viridis") %>%
layout(title = "Score Distribution per Borough")